<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
    <meta charset="UTF-8">
    <title>往期活动详情页</title>
    <meta name="page-view-size" content="1280*720">
    <link rel="stylesheet" href="css/base.css">
    <link rel="stylesheet" href="css/detailHasPicture_B.css">
    <script type="text/javascript" src="lib/js/evm.js"></script>
    <script type="text/javascript" src="lib/js/Evm_djyw.js"></script>
    <script type="text/javascript" src="lib/js/key.js"></script>
    <script src="lib/js/md5.js" type="text/javascript" charset="utf-8"></script>
    <script src="lib/js/jquery-1.11.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="lib/js/jquery.cookie.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/api.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/public.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/model.js"></script>
    <style>
        .mdole :nth-child() {}
    </style>
</head>

<body>
    <div class="theoretical-bg" id="theoreticalMain">


        <div class="underImg">
            <div class="underimg">

                <div class="erweima">
                    <img class="erweimas" src="images/erweima.png" alt="">
                    <p>扫码分享</p>
                </div>
            </div>
        </div>
        <div class="info">
            <div class="title"></div>
        </div>
        <div class="model">
            <div class="container" id="container">
                <div class="content" id="content">

                </div>
            </div>
        </div>


        <div class="model" id="likes">
            <img src="./images/0_slices/1188.png" alt="">
            <p>100</p>
        </div>
        <div class="data_time"></div>
        <div class="click_count">
            11111
        </div>
        <img src="./images/0_slices/423.png" alt="" id="img_1">
    </div>
</body>
<script>
    var modelIndex = {
        disUser: true,
        specialState: 'didi',
        index: 0, //初始位置
        listName: 'model', //模块名称
        containerId: 'theoreticalMain', //包含模块的标签id
        thisContain: 'container', //翻滚外容器
        thisDetail: 'content', //翻滚内容
    }
    var articleRun;

    function getMessage() {
        var param = {
            id: TV.GetParam('id'),
            area_id: $.cookie('TV_CST_AREA'),

        }
        GetDatas('getArticle', param, function(err, res) {
                mess = res.data;
                console.log(mess, 'mess')
                $('.title').html(TV.GetParam('titles'));
                $("#likes p").html(mess.likes)

                $(".data_time").html(mess.format_add_time)
                $(".click_count").html(mess.click_count)
                $('.content').html(mess.content)
                $('.imgs').attr('src', API_URL.imgURL + mess.img)
                    // $('.').html(mess.);
                var surl = API_URL.loginURL + "home/index/qrcode?url=" + encodeURIComponent(
                    API_URL.WXUrlDetail + '/' + TV.GetParam('id'))
                $('.erweimas').attr('src', surl)
            })
            // right.toggleFocus();
    }

    getMessage();


    function direOpt(index, directive) {
        if (directive == "up") { //上
            clearInterval(articleRun)
            switch (index) {
                case 0:
                    index = 1;
                    break;

            }
            console.log('toptop')

            if (index == 0) { //文章翻滚
                TV.articleMove(directive, modelIndex.thisContain, modelIndex.thisDetail);
            }
        } else if (directive == "down") { //下
            console.log('downdown', index)
            clearInterval(articleRun)

            switch (index) {
                case 1:
                    index = 0;
                    break;

            }
            if (index == 0) { //文章翻滚
                console.log(directive, modelIndex.thisContain, modelIndex.thisDetail, '21212')
                TV.articleMove(directive, modelIndex.thisContain, modelIndex.thisDetail);
            }
        } else if (directive == "backwards") { //左

        } else if (directive == "forwards") {

        }
        console.log(index)
        return index;
    }

    function direEnter(index) {
        console.log(index)
        if (index == 0) {
            // window.location.href = './carrousel.html?id=' + TV.GetParam('id') + '&type=activety';
        } else if (index == 1) {
            var params = {
                id: TV.GetParam('id'),
                name: EVM.cookie.getValue('TV_CST_NAME'),
                mobile: EVM.cookie.getValue('TV_CST_MOBILE'),
                // access_token: $.cookie('TV_CST_TOKEN'),
            }
            GetDatas('articleLike', params, function(err, res) {
                resOpt.call(this, res)

            });
        }
    }

    function resOpt(res) {
        // console.log(res)
        if (res.code == 0) {
            TV.PromptMsg("点赞成功");
            $("#likes p").html(res.data.likes)

        } else if (res.code == 10002) {
            TV.userLogin();
            direEnter(index);
        } else {
            TV.PromptMsg(res.message)
        }
    }
</script>
<script type="text/javascript" src="js/index.js"></script>

</html>